package com.chag.app.biz.dao.gen;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MemberMapper {
    int countByExample(MemberCriteria example);

    int deleteByExample(MemberCriteria example);

    @Delete({
        "delete from MEMBER",
        "where MEMBER_ID = #{memberId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer memberId);

    @Insert({
        "insert into MEMBER (MEMBER_ID, NAME, ",
        "PHONE, PASSWORD, ",
        "EMAIL, REG_TIME)",
        "values (#{memberId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{phone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR}, #{regTime,jdbcType=TIMESTAMP})"
    })
    int insert(Member record);

    int insertSelective(Member record);

    List<Member> selectByExample(MemberCriteria example);

    @Select({
        "select",
        "MEMBER_ID, NAME, PHONE, PASSWORD, EMAIL, REG_TIME",
        "from MEMBER",
        "where MEMBER_ID = #{memberId,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Member selectByPrimaryKey(Integer memberId);

    int updateByExampleSelective(@Param("record") Member record, @Param("example") MemberCriteria example);

    int updateByExample(@Param("record") Member record, @Param("example") MemberCriteria example);

    int updateByPrimaryKeySelective(Member record);

    @Update({
        "update MEMBER",
        "set NAME = #{name,jdbcType=VARCHAR},",
          "PHONE = #{phone,jdbcType=VARCHAR},",
          "PASSWORD = #{password,jdbcType=VARCHAR},",
          "EMAIL = #{email,jdbcType=VARCHAR},",
          "REG_TIME = #{regTime,jdbcType=TIMESTAMP}",
        "where MEMBER_ID = #{memberId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Member record);
}